package com.yida.gwj.config.enums;

import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ObjectUtil;

import java.util.List;

/**
 * 附件材料信息
 *
 * @author wkz
 */
public enum BusinessAttachmentServerTypeEnum {
    /**
     * 附件材料信息
     */
    APPLICATION_REPORT(1, "《申请报告》【纸质材料】"),
    PROJECT_BUDGET(2, "《工程预算书》(设备类的为背面有业主签字确认的报价单；工程类的为经第三方造价机构审核的预算书)【纸质材料】"),
    OWNER_COMMENTS(3, "《业主征求意见材料》：含有业主签字意见的《维修和更新、改造方案》（方案内第五条分摊方式中，专有部分的业主才可参与分摊，同样楼栋不需要参与分摊需写明原因；第六条转入账户必须为对公账户）【纸质材料】"),
    TRANSFORMATION_PLAN(4, "《维修和更新、改造方案》（业主联系电话要与业主签字一致，不可放空）【纸质材料】"),
    OWNER_CONFIRMATION_CERTIFICATE(5, "《业主确认证明》(产权人相同的合并为一户来计算户数比例)【纸质材料】"),
    PUBLICITY_PHOTOS(6, "《公示照片》(申请单位应将《报价单》及《维修和更新、改造方案》在小区各楼幢（梯）显著位置进行公示，公示照片含张贴位置的远照、可看清内容的近照及拍照日期。公示期10天以上，公示期前后各一份)【纸质材料】"),
    PUBLIC_CERTIFICATION(7, "《公示证明》【纸质材料】"),
    APPLICANT_MATERIALS(8, "《申请人主体资格材料》（业委会申请的需要提供业委会备案证明复印件（加盖公章），物业公司提供物业服务合同复印件（加盖公章）及《物业合同备案证明》）【纸质材料】"),
    MAINTENANCE_CONTRACT(9, "《维修合同》【纸质材料】"),
    ADVANCE_PAYMENT_RECEIPT(10, "《维修资金预付款收款收据》（维修资金预付款同等数额的正式普通发票复印件（两份）加盖申请单位公章及开具给主管单位的收款收据（如需拨付预付款才提供））【纸质材料】"),
    ACCOUNT_MAINTENANCE_WORKS(11, "维修工程决算书"),
    SETTLEMENT_INVOICE_RECEIPT(12, "维修资金结算发票收款收据"),
    APPLICATION_APPROPRIATE_REPORT(13, "申请拨付报告"),
    FINAL_COST_ALLOCATION_LIST(14, "决算费用分摊清册"),
    ACCEPTANCE_REPORT(15, "验收报告"),
    APPLICATION_APPROVAL(16, "申请报批表"),
    APPROPRIATE_EXAMINE(17, "使用拨付审批表"),
    OTHER(100, "《其他材料》【纸质材料】");

    private final Integer code;
    private final String info;

    BusinessAttachmentServerTypeEnum(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    /**
     * @return
     */
    public static BusinessAttachmentServerTypeEnum translate(Integer code) {
        for (BusinessAttachmentServerTypeEnum value : BusinessAttachmentServerTypeEnum.values()) {
            if (ObjectUtil.equals(value.getCode(), code)) {
                return value;
            }
        }
        return null;
    }

    public static List<BusinessAttachmentServerTypeEnum> getMaintenanceFundsServerTypeList() {
        return ListUtil.toList(BusinessAttachmentServerTypeEnum.APPLICATION_REPORT,
                BusinessAttachmentServerTypeEnum.PROJECT_BUDGET,
                BusinessAttachmentServerTypeEnum.OWNER_COMMENTS,
                BusinessAttachmentServerTypeEnum.TRANSFORMATION_PLAN,
                BusinessAttachmentServerTypeEnum.OWNER_CONFIRMATION_CERTIFICATE,
                BusinessAttachmentServerTypeEnum.PUBLICITY_PHOTOS,
                //    BusinessAttachmentServerTypeEnum.PUBLIC_CERTIFICATION,
                BusinessAttachmentServerTypeEnum.APPLICANT_MATERIALS,
                BusinessAttachmentServerTypeEnum.MAINTENANCE_CONTRACT);
    }
}
